package adapter.interfaceadapter;


import org.springframework.aop.framework.adapter.AdvisorAdapter;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter;

/**
 * 提高类的透明性和复用，现有类复用但不需要改变；
 * 目标类和适配器类解耦，提高程序的扩展性；
 * 符合开闭原则；
 *
 * 需要全面考虑，增加系统复杂性；过多使用会使代码凌乱；
 */
public class PowerAdapter implements AC{
    private AC220 ac220;
    AdvisorAdapter advisorAdapter;
    HandlerAdapter adaptor;
    HttpRequestHandlerAdapter httprequestHandlerAdapter;
    public PowerAdapter(AC220 ac220) {
        this.ac220=ac220;
    }

    @Override
    public int output5V() {
        return this.ac220.outputAC220V()/44;
    }

    @Override
    public int output6V() {
        return 0;
    }

    @Override
    public int output12V() {
        return 0;
    }
}
